﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../include/topLess.jsp" %>

<link href="${baseURL}/static/css/login.css" rel="stylesheet" type="text/css" />

<div id="pic_lef">
  <div id="pic_rig">
    <div id="pic_sun">
      <div id="sea_bg">
        <div id="pic">
        <form method="post" id="fm1" action="${baseURL}/user/login" onsubmit="return checkInput()" cssClass="fm-v clearfix" commandName="${commandName}" htmlEscape="true">
          <ul id="logo">
            <li>
				<input name="userLoginname" tabIndex="1" id="but_text01" type="text" value=""/>
            </li>
            <li>
				<input name="userPasswd" tabIndex="2" id="but_text02" type="password" value=""/>
            </li>
            <li id="login"><font color="red">${msg}</font></li>
            <li><input type="button" id="login_but" onclick="login()" /></li>
          </ul>
    	</form>
        </div>
      </div>
    </div>
  </div>
</div>

<script>

$(function(){
	
	$("input[name='userLoginname']").focus();
	
	$("input[name='userPasswd']").keyup(function(e){
		if (e.keyCode==13){
			login();
		}
	});
});

function login(){
	
	if (checkInput()){
		document.forms[0].submit();
	}
	
}


function checkInput(){
	var username = $("input[name='userLoginname']");
	if(username.val()==""){
		layer.alert("请输入用户名。");
		//username.focus();
		return false;
	}
	var password = $("input[name='userPasswd']");
	if(password.val()==""){
		layer.alert("请输入用户密码。");
		//username.focus();
		return false;
	}
	return true;
}

function isIFrameIn(){
	try{
		if(window.top ==window){
			return false;
		}else{
			return true;
		}
	}catch(e){
		return true;
	}
}
if(isIFrameIn()){
	top.location.href = window.location.href;
}

</script>

<%@ include file="../include/bottom.jsp" %>